<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<script src="${pageContext.request.contextPath}/static/js/jQuery.js"></script>
<script>
    function checkForm() {
        var typeName = $("#typeName").val();
        if(typeName==null || typeName==""){
            $("#error").html("请输入日志类别！")
            return false;
        }
        return true;
    }
</script>

<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="data_list">
    <div class="data_list_title">
        <img src="${pageContext.request.contextPath}/static/images/diaryType_add_icon.png"/>添加日志类别
    </div>
    <form action="diaryType?action=save" method="post" onsubmit="return checkForm()">
        <div class="diaryType_form">
            <table align="center">
                <tr>
                    <td>类别名称：</td>
                    <td><input type="text" id="typeName" name="typeName" value="${diaryType.typeName}" style="height: 30px;"></td>
                    <input type="hidden" id="diaryTypeId" name="diaryTypeId" value="${diaryType.diaryTypeId}">
                </tr>
                <tr>
                    <td>
                        <button type="submit" class="btn btn-primary">保存</button>
                    </td>
                    <td>
                        <button type="button" class="btn btn-primary" onclick="window.history.back()">返回</button>
                    </td>
                    <span id="error" style="color:red"></span>
                </tr>
            </table>
        </div>
    </form>
</div>
</body>
</html>
